<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改账务检核作业管理')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-account-edit" th:object="${verifyAccountTaskManage}">
            <input name="taskId" th:field="*{taskId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">作业代码：</label>
                <div class="col-sm-8">
                    <input name="taskCode" th:field="*{taskCode}"  required readonly="true" class="form-control" type="text"/>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">作业名称：</label>
                <div class="col-sm-8">
                    <input name="taskName" th:field="*{taskName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">系统代码：</label>
                <div class="col-sm-8">
                   <div class="input-group">
						<input type="hidden" id="sysId" name="sysId" th:field="*{sysId}" />
						<input name="sysCode" th:field="*{sysCode}"
							onclick="selectMdSysModel()" id="sysCode" type="text"
							placeholder="请选择系统" class="form-control"> <span
							class="input-group-addon"><i class="fa fa-search"></i></span>
					</div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">系统名称：</label>
                <div class="col-sm-8">
                   <input id="sysName" th:field="*{sysName}" name="sysName" class="form-control" readonly="true" type="text" />
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">账务类型：</label>
                <div class="col-sm-8">
                    <select name="accountType" class="form-control m-b" th:with="type=${@dict.getType('account_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{accountType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">作业类名：</label>
                <div class="col-sm-8">
                    <input name="className" th:field="*{className}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">类包名：</label>
                <div class="col-sm-8">
                    <input name="packageName" th:field="*{packageName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">总计SQL：</label>
                <div class="col-sm-8">
                    <input name="amountSql" th:field="*{amountSql}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">明细SQL：</label>
                <div class="col-sm-8">
                    <textarea name="detailsSql" th:field="*{detailsSql}" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">作业描述：</label>
                <div class="col-sm-8">
                    <textarea name="taskRemark" th:field="*{taskRemark}" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
		var prefix = ctx + "verify/account";
		var prefix2 = ctx + "verify/rule";
		$("#form-account-edit").validate({
			focusCleanup : true
		});
		
		function submitHandler() {
			if ($.validate.form()) {
				$.operate.save(prefix + "/edit", $(
						'#form-account-edit').serialize());
			}
		}
		
		/* 选择系统 */
		function selectMdSysModel() {
			debugger;
			var url = prefix2 + "/showMdSysList";
			var options = {
				title : '选择系统',
				width : "600",
				url : url,
				callBack : doSubmitMdSysData
			};
			$.modal.openOptions(options);
		}
		
		function doSubmitMdSysData(index, layero) {
			debugger;
			var tableObj = layero.find("iframe")[0].contentWindow.$.table;
			var sysId = tableObj.selectColumns("sysId")[0];
			var sysCode = tableObj.selectColumns("sysCode")[0];
			var sysName = tableObj.selectColumns("sysName")[0];
			$("#sysId").val(sysId);
			$("#sysCode").val(sysCode);
			$("#sysName").val(sysName);
			layer.close(index);
		}
</script>
</body>
</html>